<?php

$menu = ShopMenu::model()->findAll(' `flag`=1 and `parentID`=0 and `shopid`=1');
if (!empty($menu)) {
    $lan=0;
    foreach ($menu as $m) {
        echo $lan +=1;
    }
}
?>